Fix primitive parameter type handling in dynamic CLI generation#52768
Fix primitive parameter type handling in dynamic CLI generation#52768bugraoz93 merged 1 commit intoapache:mainfrom
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
bugraoz93
left a comment
There was a problem hiding this comment.
Many thanks for your first PR @mohiuddin-khan-shiam! Amazing work! The Boolean part was in my TODO as a bug. I have tested and it works. It is amazing to see you fixed the bug and you also enhanced/streamlined the mapping parsing.
It looks great! Could you please rebase your branch? We can merge afterwards
|
Done. |
|
Thanks for the rebase, but I think you merged the changes rather than rebase! Could you please also run static checks (pre-commit hooks) in your localand push? it is failing on the CI for ruff format and if we merge, it will break main. :) Sorry for double work! |
8e3a4c7 to
a8829dc
Compare
|
Thanks for the review! I've:
The PR should now be clean and ready for another look. Let me know if you need anything else! |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
|
Congrats @mohiuddin-khan-shiam! Thanks for your work! |
|
Welcome |
Description
Problem
Primitive parameters discovered via OpenAPI introspection were always registered
with
argparseas str because the code used type(parameter_type) whereparameter_typeitself was already a string. This caused:BooleanOptionalAction,Solution
(
"int","float","bool", …) to their real Python counterparts.booleans with
BooleanOptionalAction.datetimeto supportdatetime.datetimemapping.Impact
CLI arguments now receive the correct Python types at parse-time, preventing
type-related runtime errors and ensuring the generated payloads match the
API schema.